#ifndef __STREAMBUFFER_H__
#define __STREAMBUFFER_H__

#define SB_SIZE 4

#define SB_SRF_BUS_SIZE 4

#define SB_DEFUALT_VALUE 0

#define SB_UNDEFINED 0
#define SB_INT 1
#define SB_FLOAT 2

#define SB_NOP 0
#define SB_WRITE_BUS 1
#define SB_READ_BUS 2
#define SB_WRITE_CLIENT 3
#define SB_WRITE_FLOAT_CLIENT 4
#define SB_READ_CLIENT 5
#define SB_READ_FLOAT_CLIENT 6

//StreamBuffer
class Streambuffer
{

public:
	Streambuffer();
	int control;
	int control_loc;
	int srf_bus[SB_SRF_BUS_SIZE];
	float srf_bus_f[SB_SRF_BUS_SIZE/2];
	char srf_bus_stat[SB_SRF_BUS_SIZE];
	char sb_stat[SB_SIZE];
	int  client;
	float client_f;
	void update();
	bool isReady();

private:
	int CyclesLeft;
	bool Ready;
	int sb[SB_SIZE];
	float sb_f[SB_SIZE/2];
};

#endif